package test.ui {
	import gear.core.Game;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.controls.GLabel;
	import gear.ui.data.GLabelData;
	import gear.utils.GUIDUtil;

	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;

	/**
	 * @author bright
	 * @version 20101027
	 */
	[SWF(width=550,height=400,backgroundColor=0x333333,frameRate=48)]
	public class TestGLabel extends Game {
		override protected function startup() : void {
			RESManager.instance.add(new SWFLoader(new LibData("assets/ui.swf")));
			RESManager.instance.addEventListener(Event.COMPLETE, completeHandler);
			RESManager.instance.load();
		}

		private function completeHandler(event : Event) : void {
			var tf : TextField = new TextField();
			tf.x = 100;
			tf.y = 100;
			tf.text = "中文测试ABC";
			tf.textColor = 0xFF0000;
			addChild(tf);
			var data : GLabelData = new GLabelData();
			var label : GLabel = new GLabel(data);
			addChild(label);
			var debug : Sprite = new Sprite();
			debug.graphics.lineStyle(1, 0xFF0000, 1);
			debug.graphics.drawRect(label.x, label.y, label.width, label.height);
			addChild(debug);
			trace(GUIDUtil.createUID());
		}
	}
}
